<?php
apf_require_class("APF_Component");
apf_require_class("Bll_Jx_Relation");

class HeaderComponent extends APF_Component {
    public function get_view() {

        $this->team_bll = new Bll_Jx_Relation();
        $uid=APF::get_instance()->get_request()->get_user_id();
        $user_code = APF::get_instance()->get_request()->get_user_code();
        $my_info = $this->team_bll->get_user_info($uid);
        $is_217 = $is_super = $is_hr =0;
        //是否HR
        $hr_auth = APF::get_instance()->get_config('hr_auth');
        if(in_array($user_code,$hr_auth)){
            $is_hr =1;
        }
        if($my_info['is271Leader'] || $is_hr){
            $is_217 =1;
        }
        //有下属
        $sub_list = $this->team_bll->get_lower_user($user_code);
        if($sub_list){
            $is_super=1;
        }

        $this->assign_data("is_hr", $is_hr);
        $this->assign_data("is_217", $is_217);
        $this->assign_data("is_super", $is_super);
        $this->assign_data("user_name", APF::get_instance()->get_request()->get_user_name());
        return 'Header';
    }
}